package cn.iocoder.yudao.module.shop.dal.mysql.memberhealth;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.memberhealth.ShopMemberHealthDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.memberhealth.vo.*;

/**
 * 收支记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ShopMemberHealthMapper extends BaseMapperX<ShopMemberHealthDO> {

    default PageResult<ShopMemberHealthDO> selectPage(ShopMemberHealthPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopMemberHealthDO>()
                .eqIfPresent(ShopMemberHealthDO::getMemberId, reqVO.getMemberId())
                .likeIfPresent(ShopMemberHealthDO::getTags, reqVO.getTags())
                .betweenIfPresent(ShopMemberHealthDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopMemberHealthDO::getId));
    }

    default List<ShopMemberHealthDO> selectList(ShopMemberHealthExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopMemberHealthDO>()
                .eqIfPresent(ShopMemberHealthDO::getMemberId, reqVO.getMemberId())
                .likeIfPresent(ShopMemberHealthDO::getTags, reqVO.getTags())
                .betweenIfPresent(ShopMemberHealthDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopMemberHealthDO::getId));
    }

}
